package com.starblink.android.common.route

import android.content.Context
import android.util.Log
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Interceptor
import com.alibaba.android.arouter.facade.callback.InterceptorCallback
import com.alibaba.android.arouter.facade.template.IInterceptor
import com.starblink.android.common.BuildConfig

@Interceptor(priority = 99, name = "MainRouterInterceptor")
class MainRouterInterceptor: IInterceptor {

    override fun init(context: Context?) {

    }

    override fun process(postcard: Postcard?, callback: InterceptorCallback?) {
        if(BuildConfig.DEBUG) {
            Log.d("ARouter", "打印跳转路由${postcard?.path}")
        }
        callback?.onContinue(postcard)
    }
}